package com.hs.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//请在这里配置您的基本信息

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000116682394";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQClXllcBeS7W7CA1cL9/nvzNdMIEC1qeJZh1JjHj4uTJktUF7gNXKgRURFNhNSrjtlXlCO0BUcpyn+2VtTe61xU/hV4s0Rp/9/pbvlayxCfT9Z+ZGWiGS/m9TB36TAl9JK0uMFvmb2NIPKDNwGOaADpgSQgoNZV+0nfuNCe1vj7ekZr05oTn9Yw77I8neWhhcaFDIEWtjyL0AUqFq5N7jV8zzF56512qlCqTk9skzZmkpJIpkr1e9Zk3H9lZnU13besYvhHE+HHZAuaOdCe74T3U7fatMOfQpdNFnV7mkAhPdcdhOJdbbKXGZAWw+PCH0bwjmuHpHw8soeEMNl+2kR1AgMBAAECggEAOnbq3M/wmBTIiCQK9kV8iPXkkBs4E0Zi1F+XTCaB0Bpf03E3TvINMWIZ3fAySB0O1hm3rbOX/zxqfoqgY9eOIzZZXPz0GQ2vmhXz7peQXuKZEMJp9C83ck4JPrugnCqlm2MecFhIXZbiZmWSFUjL2cIghbCXVnqrGX97skyKZk24uqDvMQ5SQQkflPVXPUNGxPhM55ZHiHuf4c5fsFsAicFvDprVbPvfI7WDz28UxYvLOq6AGnkLre5wQkr7HOe5bsCpbN47j42NJG9RxvW4FBksjvRxmR2qHC0a1vAB//sZ3DslRU4rC51jnPiqovvRjBBCvsyRUFHW31hJdJys2QKBgQDcHOKquitrwuMsk8YBwsr8VrA1zJxwIonx7/6Gm+/qBHoyHtTZlfiI29oOvyBrt8gYtKW2Qi18XzySXuCA+SOS+6eF7TJ2OzTPSpkBwZ6hdk6805r9ydXBZnvTQ6ZzGsfeW2zIswu1CcNX+eMIchAka2ElzHIhyW0Za1xcfcEr6wKBgQDAVIkZwTVEwrvLAC9IoM6AG3/fXcbPUdZphixhQFaK4bGCyqN1uIG9NEtgpGaRy/m7pP+OQl/72oLX6gxE+55XRDAkTsqWrzJjSpAOSAfSn5xXaodN3vq7fvmp+W3V0feNrk5ETw9R1aKYyRp9zMAhWbDmA9xqLIY09jZkxoQZHwKBgQCmGmYy0CrUN02X5iwWSBlGM2TmNHIZbPcMTD+W9TYnMxnDmOCnEjVrkf0MA89DenzVp/0lfOs2X+glzNM+gMQHt0DEICtkbWl8xJ6SZLqAvfbNKCJeQmG8gMoQs4x4cE1Dz1pYWkULaUKwsTJSvUDROvckvxOhy485D3uzkHKl4QKBgCL5vIzwc81zVE9QU0jz5VmqppBqL1NYYJOEEOIGnzZWYL+WNi+cRAuyTNrgSr7Mxzd2g/rM20OjsxOsvlp1H5BjGBYiNfk9Fv6zeor+Ul3dJMNI3h4tJI+gQarFb1HpAwnC3vzRG8oX/Z+nQqgJ6g6mjuLlZNnyCt3qwG2HJFKlAoGANWNWcrvNV5NWZgaxlsSjJC6cl9O3tk2PflvKcS7CLsW2oPo6rStL8tu2Qe97mjRmrgAM7COJuB6kdzvCJbrAADhK3sFpbwrK5hisBBE+dM2l/eYgj0pag80bp0+r8wLhOazXI8CKWhmYA9/ZqurArkP42Lf4eZn7ej+Dv/G27Zg=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvoV/AULgJIXMMDmnuvD18pZGy0ULZ9ei92nEUMdkUyll75DKlbd+rpbQfWxVZVSLfkBY80EGE18cAzto2NWt9/0Tvg1WA4z/YvgULKKOacMbS7wpPmE0udhauqy1sA8O6Ow10CtXBr+oJ4TNsdFZ2iEYxF1RXxyokIZdsFhNp+LZdCb9ObrqTGvQjBenmtScIS3qNumSU7DC/ylENRt2mvewJWMiwUAfyJgzLMuulGWLHJ3BJS2B3hhAXRY8u+kDl+In5r/Ffe7hYvuSvkEqB87CukJyI1vN5QSnKinLEfPASNnUuBWOf6QU0DVbDqCpBBCZo26PuICH9I+mJalreQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "  http://www.hsxd.club:80/pay/paySuccess";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "  http://www.hsxd.club:80/pay/paySuccess";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\Alipay\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

